using System;
using System.Data;
using System.Configuration;
using System.Web.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace XZ.Content.Mailings
{
    public class MailingsSection : ConfigurationSection
    {
        [ConfigurationProperty("providers")]
        public ProviderSettingsCollection Providers
        {
            get { return (ProviderSettingsCollection)base["providers"]; }
        }

        [StringValidator(MinLength = 1)]
        [ConfigurationProperty("defaultProvider",
            DefaultValue = "SqlMailingProvider")]
        public string DefaultProvider
        {
            get { return (string)base["defaultProvider"]; }
            set { base["defaultProvider"] = value; }
        }

        [ConfigurationProperty("fromEmail", IsRequired = true)]
        public string FromEmail
        {
            get { return (string)base["fromEmail"]; }
            set { base["fromEmail"] = value; }
        }

        [ConfigurationProperty("fromDisplayName", IsRequired = true)]
        public string FromDisplayName
        {
            get { return (string)base["fromDisplayName"]; }
            set { base["fromDisplayName"] = value; }
        }

        [ConfigurationProperty("hideFromArchiveInterval", DefaultValue = "15")]
        public int HideFromArchiveInterval
        {
            get { return (int)base["hideFromArchiveInterval"]; }
            set { base["hideFromArchiveInterval"] = value; }
        }

        [ConfigurationProperty("archiveIsPublic", DefaultValue = "false")]
        public bool ArchiveIsPublic
        {
            get { return (bool)base["archiveIsPublic"]; }
            set { base["archiveIsPublic"] = value; }
        }

        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
            set { base["enableCaching"] = value; }
        }

        [ConfigurationProperty("cacheDuration")]
        public int CacheDuration
        {
            get { return (int)base["cacheDuration"]; }
            set { base["cacheDuration"] = value; }
        }
    }
}
